﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LanDBom.Models.Procure
{
    public class Modlfy_Inf_zhuang
    {
        LDbaseEntities LD = new LDbaseEntities();
        public Informa Getinf(int inf_id)
        {
            Informa inf = LD.Informa.SingleOrDefault(x => x.Inf_id == inf_id);

            return inf;
        }

        public int ChangeInf_zhuang(Informa inf)
        {
            int temp;
            Informa infs = Getinf(inf.Inf_id);
            infs.Inf_zhuang = inf.Inf_zhuang;
            temp=LD.SaveChanges();
            List<Informa> list = LD.Informa.Where(x => x.Inf_shen == infs.Inf_shen).ToList();
            foreach(Informa informa in list)
            {
                informa.Inf_zhuang = "已提交";
            }
            return temp;
        }
    }
}